package com.soft.javase.day06;

import java.time.LocalDate;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/24
 */
public class Student {
    private String name;
    private String studentId;
    private LocalDate birthDate;

    public Student(String name, String studentId, LocalDate birthDate) {
        this.name = name;
        this.studentId = studentId;
        this.birthDate = birthDate;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", studentId='" + studentId + '\'' +
                ", birthDate=" + birthDate +
                '}';
    }

    public LocalDate getBirthDate() {
        return birthDate;
    }

    public String getName() {
        return name;
    }

    public static void main(String[] args) {
        Student[] students = new Student[5];

        students[0] = new Student("张三", "1001", LocalDate.of(2000, 5, 15));
        students[1] = new Student("李四", "1002", LocalDate.of(1999, 8, 20));
        students[2] = new Student("王五", "1003", LocalDate.of(2001, 3, 10));
        students[3] = new Student("赵六", "1004", LocalDate.of(1998, 11, 25));
        students[4] = new Student("钱七", "1005", LocalDate.of(2000, 7, 30));

        LocalDate zhangSanBirthDate = null;
        for (Student s : students) {
            if (s.getName().equals("张三")) {
                zhangSanBirthDate = s.getBirthDate();
            }
        }

        for (Student student : students) {
            if(student.getBirthDate().isAfter(zhangSanBirthDate)){
                System.out.println(student);
            }

        }
    }

}
